#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <pthread.h>
#include "log_client_api.h"

int main(int argc,char**argv)
{
    int iret = 0;
    long i = 0;
    long global_num = 0;
    char buff[] = "333333333xxxxxxxxxxxxxxxxxxxxxxxxxx this is a test string333333333xxxxxxxxxxxxxxxxxxxxxxxxxx this is a";
    
    log_client_conf conf;
    memset(&conf,0,sizeof(conf));
    conf.log_severity = DEBG;
    conf.max_log_size = 10;
    conf.flags = LOG_MSG_STORE_REMOTE|LOG_MSG_STORE_LOCAL;
    //conf.flags = LOG_MSG_STORE_MONITOR;
    strcpy(conf.local_log_path,"test.log");
    strcpy(conf.process_name,"hplogd");
    
    if(argc == 1)
        return NOERR;
    iret = init_hplog(&conf);
    if(iret)
        plogerr(iret);
    
    global_num = atol(argv[1]);    
    for(i=0; i < global_num; i++)
    {
        srand(time(NULL));
        iret = rand();
        buff[iret&63]= '\0';
        tx_log(EMGT,"%s",buff);
        log_debg("string from the c/c++");
        hplog_output(WARN,"number is %d,%s tell me the secret",3,"Elle");
    }

    return NOERR;
}

